/**
 * @version 1.0
 * @created 03 December 2010
 *
 * AuctionService
 *
 * Copyright @ 2010 by CES
 * All Rights Reserved.
 * CES CONFIDENTIAL AND TRADE SECRET
 * 
 */
package com.ces.knacky.services;

import java.util.List;

import com.ces.knacky.framework.exception.DataAccessException;
import com.ces.knacky.framework.services.CommonService;
import com.ces.knacky.model.Bid;
import com.ces.knacky.model.BidWorkflowAudit;

/**
 * AuctionService provides back-end services to the bid-now front-end.
 * It provides methods for placing a bid,bid approval,calling paypal to verify the account balance,
 * placing cancel order,issue an order request for approved bids.
 * 
 * @author shivangi_walvekar
 *
 */
public interface AuctionService extends CommonService{
	/**
	 * @param - itemId - the id of the selected item.
	 * 			auctionDescription - description of the selected auction.
	 * @return - true if the bid is places successfully,false otherwise.
	 */
	boolean placeBid(int itemId,int auctionId,Float bidPrice);

	/**
	 * @param selectedIds - selected work flow bid ids to approve
	 * @return - true if approved successfully
	 * @throws DataAccessException 
	 */
	boolean approveBid(String selectedIds);
	/**
	 * It is used to approve bids automatically. It finds all those auctions which are in live state
	 * and approval has taken place. It selects bid with higher value and mark it as approved.
	 */
	void automaticApproveBid();

	/**
	 * @return - list of bids having placed as status
	 */
	List<Bid> loadPlacedBid();
	
	/**
	 * @return - list of bids for the specified userId
	 */
	List<Bid> loadMyBids(Integer userId);
	
	/** This method cancels the placed bids for the selected bid workflow audit Ids.
	 * @param selectedIds - selected work flow bid ids to cancel
	 * @return - true if cancelled successfully
	 */
	boolean cancelBids(String selectedIds);
	
	boolean cancelPlacedBids();
	
	boolean cancelApprovedBids(List<BidWorkflowAudit> approvedBids);


}
